package jjn.acwing.java_basic;

import java.util.Scanner;

/**
 * @author Jjn
 * @since 2023/9/5 23:01
 */
public class Acwing762 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            double threshold = scanner.nextDouble();
            String first = scanner.next();
            String second = scanner.next();
            int matched = 0;
            for (int i = 0; i < first.length(); i++) {
                if (first.charAt(i) == second.charAt(i)) {
                    matched++;
                }
            }
            double v = threshold * first.length();
            if (matched >= v) {
                System.out.println("yes");
            } else {
                System.out.println("no");
            }
        }
    }
}
